package cn.iocoder.yudao.module.handguard.dal.mysql.labeltable;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.labeltable.LabelTableDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.admin.labeltable.vo.*;

/**
 * 标签 Mapper
 *
 * @author 超管
 */
@Mapper
public interface LabelTableMapper extends BaseMapperX<LabelTableDO> {

    default PageResult<LabelTableDO> selectPage(LabelTablePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LabelTableDO>()
                .eqIfPresent(LabelTableDO::getLabelType, reqVO.getLabelType())
                .likeIfPresent(LabelTableDO::getLabelName, reqVO.getLabelName())
                .betweenIfPresent(LabelTableDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LabelTableDO::getId));
    }

    default List<LabelTableDO> selectList(LabelTableExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<LabelTableDO>()
                .eqIfPresent(LabelTableDO::getLabelType, reqVO.getLabelType())
                .likeIfPresent(LabelTableDO::getLabelName, reqVO.getLabelName())
                .betweenIfPresent(LabelTableDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LabelTableDO::getId));
    }

}
